#
# Copyright (C) 2011 Ivan Vazquez <ivan@ivanvazquez.com>
#

include $(TOPDIR)/rules.mk

PKG_NAME:=mpoppins
PKG_RELEASE:=1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk


LIBS= -lrt -lasound -lm -ldl -lpthread 
#TARGET_CFLAGS += 
TARGET_LDFLAGS += ${LIBS}
#MAKE_VARS += FPIC="$(FPIC)"

define Package/mpoppins
  DEPENDS:=+alsa-lib +libpthread
  SECTION:=sound
  CATEGORY:=Sound
  TITLE:=mpoppins - tiny sound server
endef

define Package/mpoppins/description
 mpoppins is a tiny sound server
endef

define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

define Build/Configure
endef

define Build/Compile
	$(MAKE) -C $(PKG_BUILD_DIR) \
		CC="$(TARGET_CC)" \
		CFLAGS="$(TARGET_CFLAGS) -Wall" \
		LDFLAGS="$(TARGET_LDFLAGS)"
endef



define Package/mpoppins/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/mpoppins/mpoppins $(1)/usr/sbin/
endef


$(eval $(call BuildPackage,mpoppins))
